﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NGUYENTHANHDONG.OOP.Inhertance___Polimophism.TEST.EXCERCISE_01
{
    class TamGiac: GeometricObject
    {
        double side1, side2, side3;

        public double SIDE3
        {
            get { return side3; }
            set { side3 = value; }
        }

        public double SIDE2
        {
            get { return side2; }
            set { side2 = value; }
        }

        public double SIDE1
        {
            get { return side1; }
            set { side1 = value; }
        }
        public TamGiac()
        { }

        public TamGiac(double side1, double side2, double side3)
        {
            this.side1 = side1;
            this.side2 = side2;
            this.side3 = side3;
        }


        public override double GetPerimeter()
        {
            return (side1 + side2 + side3);
        }
        public override double GetArea()
        {
            double p = (side3 + side2 + side1) / 2;
            return Math.Sqrt(p * (p - side1) * (p - side2) * (p - side3));
        }
       
    }
}
